package cn.fl.riskctrl.controller;

import cmm.mid.core.framework.page.DataResultVO;
import cmm.web.core.framework.controller.BaseController;
import cn.cmm.base.framework.constant.BaseConstant;
import cn.cmm.base.framework.exception.BaseException;
import cn.cmm.base.framework.utils.BaseLogUtils;
import cn.cmm.base.framework.utils.StringUtils;
import cn.cmm.cache.framework.utils.PropertiesCacheUtils;
import cn.fl.framework.base.context.CurrentThreadContext;
import cn.fl.riskctrl.service.IRskCtrlRecService;
import cn.fl.system.constant.SysLogConstant;
import fl.constant.facade.framework.constant.UploadConstant;
import fl.riskctrl.facade.riskctrl.condition.RskCtrlIsCorrectQC;
import fl.riskctrl.facade.riskctrl.dto.DataResultDTO;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.ArrayList;
import java.util.List;

/**
 * @Description: 征信查询-控制层
 */
@Controller
@RequestMapping("/riskctrl/rskctrlrec")
public class RskCtrlRecController extends BaseController {

	private static final Logger logger = LoggerFactory.getLogger(RskCtrlRecController.class);
	
	/**
	 * 征信查询服务
	 */
	@Autowired
	private IRskCtrlRecService rskCtrlRecService;
	
	/**
	 * 到征信主页面
	 */
//	@RequestMapping(value = "/toMainPage.do", method = { RequestMethod.GET })
//	public ModelAndView toMainPage(HttpServletRequest request, HttpServletResponse response) {
//		ModelAndView view = new ModelAndView("riskctrl/riskctrlrec/riskCtrlRecMain");
//		String path = PropertiesCacheUtils.getProperty(UploadConstant.UPLOAD_SERVER_PATH);
//		view.addObject("zx_path", path);
//		return view;
//	}
//	/**
//	 * 获取风控数据
//	 */
//	@RequestMapping(value = "/getRiskCtrlData.do", method = { RequestMethod.GET })
//	@ResponseBody
//	public Object getRiskCtrlData(HttpServletRequest request, HttpServletResponse response) throws BaseException {
//        Long startTm = System.currentTimeMillis();
//        BaseLogUtils.info(logger, "getRiskCtrlData", " 获取风控数据.请求参数：" + this.getRequestParameter(request), CurrentThreadContext.getCurrentUserName());
//		String name = request.getParameter("name");//姓名
//		String certNo = request.getParameter("certNo");//证件号
//		String phone = request.getParameter("phone");//手机号
//		String cardNo = request.getParameter("cardNo");//银行卡号
//		DataResultVO result = new DataResultVO(BaseConstant.IS_YESNO_YES, SysLogConstant.LOG_CMM_OPERATE_SUCC);
//		if (StringUtils.isEmpty(name) || StringUtils.isEmpty(certNo) || StringUtils.isEmpty(phone)) {
//			result.setSuccess(BaseConstant.IS_YESNO_NO);
//			result.setInfo("姓名、证件号、手机号不能为空");
//			BaseLogUtils.info(logger, "getRiskCtrlData", this.getRequestParameter(request));
//			return result;
//		}
//		try {
//			RskCtrlIsCorrectQC qc = new RskCtrlIsCorrectQC();
//			qc.setName(name);
//			qc.setCertNo(certNo);
//			qc.setPhone(phone);
//			List<String> list = new ArrayList<String>();
//			list.add(cardNo);
//			qc.setCardNos(list);
//			DataResultDTO data = this.rskCtrlRecService.getRiskCtrlIsCorrect(qc);
//			result.setData(data.getData());
//		} catch (BaseException ex) {
//			BaseLogUtils.error(logger, "-", "异常", ex);
//			result.setSuccess(BaseConstant.IS_YESNO_NO);
//			result.setInfo(ex.getMessage());
//			BaseLogUtils.info(logger, "getRiskCtrlData", "获取数据失败!" + this.getRequestParameter(request) + ", ERROR : " + ex.getMessage(), CurrentThreadContext.getCurrentUserName());
//		} catch (Exception ex) {
//			BaseLogUtils.error(logger, "-", "异常", ex);
//			result.setSuccess(BaseConstant.IS_YESNO_NO);
//			result.setInfo(SysLogConstant.LOG_CMM_SYS_ERROR);
//			BaseLogUtils.error(logger, "getRiskCtrlData", "获取数据失败!" + this.getRequestParameter(request) + ", ERROR : " + ex.getMessage(), CurrentThreadContext.getCurrentUserName());
//		}
//        Long endTm = System.currentTimeMillis();
//        BaseLogUtils.info(logger, "getRiskCtrlData", " 获取风控数据.耗时：" + (endTm-startTm), CurrentThreadContext.getCurrentUserName());
//		return result;
//	}

	/**
	 * 获取鹏元数据
	 */
	@RequestMapping(value = "/getPYJyIsCorrectData.do", method = { RequestMethod.GET })
	@ResponseBody
	public Object getPYJyIsCorrectData(HttpServletRequest request, HttpServletResponse response) throws BaseException {
        Long startTm = System.currentTimeMillis();
        BaseLogUtils.info(logger, "getPYJyIsCorrectData", " 获取鹏元数据.请求参数：" + this.getRequestParameter(request), CurrentThreadContext.getCurrentUserName());
		String name = request.getParameter("name");//姓名
		String certNo = request.getParameter("certNo");//证件号
		String phone = request.getParameter("phone");//手机号
		DataResultVO result = new DataResultVO(BaseConstant.IS_YESNO_YES, SysLogConstant.LOG_CMM_OPERATE_SUCC);
		if (StringUtils.isEmpty(name) || StringUtils.isEmpty(certNo) || StringUtils.isEmpty(phone)) {
			result.setSuccess(BaseConstant.IS_YESNO_NO);
			result.setInfo("姓名、证件号、手机号不能为空");
			BaseLogUtils.info(logger, "getPYJyIsCorrectData", this.getRequestParameter(request));
			return result;
		}
		try {
			RskCtrlIsCorrectQC qc = new RskCtrlIsCorrectQC();
			qc.setName(name);
			qc.setCertNo(certNo);
			qc.setPhone(phone);
			DataResultDTO data = this.rskCtrlRecService.checkPYJyIsCorrect(qc);
			result.setData(data.getData());
		} catch (BaseException ex) {
			ex.getStackTrace();
			result.setSuccess(BaseConstant.IS_YESNO_NO);
			result.setInfo(ex.getMessage());
			BaseLogUtils.info(logger, "getPYJyIsCorrectData", "获取数据失败!" + this.getRequestParameter(request) + ", ERROR : " + ex.getMessage(), CurrentThreadContext.getCurrentUserName());
		} catch (Exception ex) {
			ex.getStackTrace();
			result.setSuccess(BaseConstant.IS_YESNO_NO);
			result.setInfo(SysLogConstant.LOG_CMM_SYS_ERROR);
			BaseLogUtils.error(logger, "getPYJyIsCorrectData", "获取数据失败!" + this.getRequestParameter(request) + ", ERROR : " + ex.getMessage(), CurrentThreadContext.getCurrentUserName());
		}
        Long endTm = System.currentTimeMillis();
        BaseLogUtils.info(logger, "getPYJyIsCorrectData", " 获取鹏元数据.耗时：" + (endTm-startTm), CurrentThreadContext.getCurrentUserName());
		return result;
	}
	
	/**
	 * 获取鹏元数据
	 */
	@RequestMapping(value = "/getPYJzIsCorrectData.do", method = { RequestMethod.GET })
	@ResponseBody
	public Object getPYJzIsCorrectData(HttpServletRequest request, HttpServletResponse response) throws BaseException {
        Long startTm = System.currentTimeMillis();
        BaseLogUtils.info(logger, "getPYJzIsCorrectData", " 获取鹏元数据.请求参数：" + this.getRequestParameter(request), CurrentThreadContext.getCurrentUserName());
		String name = request.getParameter("name");//姓名
		String certNo = request.getParameter("certNo");//证件号
		String phone = request.getParameter("phone");//手机号
		DataResultVO result = new DataResultVO(BaseConstant.IS_YESNO_YES, SysLogConstant.LOG_CMM_OPERATE_SUCC);
		if (StringUtils.isEmpty(name) || StringUtils.isEmpty(certNo) || StringUtils.isEmpty(phone)) {
			result.setSuccess(BaseConstant.IS_YESNO_NO);
			result.setInfo("姓名、证件号、手机号不能为空");
			BaseLogUtils.info(logger, "getPYJzIsCorrectData", this.getRequestParameter(request));
			return result;
		}
		try {
			RskCtrlIsCorrectQC qc = new RskCtrlIsCorrectQC();
			qc.setName(name);
			qc.setCertNo(certNo);
			qc.setPhone(phone);
			DataResultDTO data = this.rskCtrlRecService.checkPYJzIsCorrect(qc);
			result.setData(data.getData());
		} catch (BaseException ex) {
			ex.getStackTrace();
			result.setSuccess(BaseConstant.IS_YESNO_NO);
			result.setInfo(ex.getMessage());
			BaseLogUtils.info(logger, "getPYJzIsCorrectData", "获取数据失败!" + this.getRequestParameter(request) + ", ERROR : " + ex.getMessage(), CurrentThreadContext.getCurrentUserName());
		} catch (Exception ex) {
			ex.getStackTrace();
			result.setSuccess(BaseConstant.IS_YESNO_NO);
			result.setInfo(SysLogConstant.LOG_CMM_SYS_ERROR);
			BaseLogUtils.error(logger, "getPYJzIsCorrectData", "获取数据失败!" + this.getRequestParameter(request) + ", ERROR : " + ex.getMessage(), CurrentThreadContext.getCurrentUserName());
		}
        Long endTm = System.currentTimeMillis();
        BaseLogUtils.info(logger, "getPYJzIsCorrectData", " 获取鹏元数据.耗时：" + (endTm-startTm), CurrentThreadContext.getCurrentUserName());
		return result;
	}


	/**
	 * 获取鹏元卡交易数据
	 */
	@RequestMapping(value = "/getKJYIsCorrectData.do", method = { RequestMethod.GET })
	@ResponseBody
	public Object getKJYIsCorrectData(HttpServletRequest request, HttpServletResponse response) throws BaseException {
        Long startTm = System.currentTimeMillis();
        BaseLogUtils.info(logger, "getKJYIsCorrectData", " 获取鹏元卡交易数据.请求参数：" + this.getRequestParameter(request), CurrentThreadContext.getCurrentUserName());
		String name = request.getParameter("name");//姓名
		String certNo = request.getParameter("certNo");//证件号
		String phone = request.getParameter("phone");//手机号
		String cardNo = request.getParameter("cardNo");//银行卡号
		DataResultVO result = new DataResultVO(BaseConstant.IS_YESNO_YES, SysLogConstant.LOG_CMM_OPERATE_SUCC);
		if (StringUtils.isEmpty(name) || StringUtils.isEmpty(certNo) || StringUtils.isEmpty(phone)) {
			result.setSuccess(BaseConstant.IS_YESNO_NO);
			result.setInfo("姓名、证件号、手机号不能为空");
			BaseLogUtils.info(logger, "getKJYIsCorrectData", this.getRequestParameter(request));
			return result;
		}
		try {
			RskCtrlIsCorrectQC qc = new RskCtrlIsCorrectQC();
			qc.setName(name);
			qc.setCertNo(certNo);
			qc.setPhone(phone);
			List<String> list = new ArrayList<String>();
			list.add(cardNo);
			qc.setCardNos(list);
			DataResultDTO data = this.rskCtrlRecService.checkKJYIsCorrect(qc);
			result.setData(data.getData());
		} catch (BaseException ex) {
			ex.getStackTrace();
			result.setSuccess(BaseConstant.IS_YESNO_NO);
			result.setInfo(ex.getMessage());
			BaseLogUtils.info(logger, "getKJYIsCorrectData", "获取数据失败!" + this.getRequestParameter(request) + ", ERROR : " + ex.getMessage(), CurrentThreadContext.getCurrentUserName());
		} catch (Exception ex) {
			ex.getStackTrace();
			result.setSuccess(BaseConstant.IS_YESNO_NO);
			result.setInfo(SysLogConstant.LOG_CMM_SYS_ERROR);
			BaseLogUtils.error(logger, "getKJYIsCorrectData", "获取数据失败!" + this.getRequestParameter(request) + ", ERROR : " + ex.getMessage(), CurrentThreadContext.getCurrentUserName());
		}
        Long endTm = System.currentTimeMillis();
        BaseLogUtils.info(logger, "getKJYIsCorrectData", " 获取鹏元卡交易数据.耗时：" + (endTm-startTm), CurrentThreadContext.getCurrentUserName());
		return result;
	}


	/**
	 * 获取鹏元三要素手机核查数据
	 */
	@RequestMapping(value = "/getSYSIsCorrectData.do", method = { RequestMethod.GET })
	@ResponseBody
	public Object getSYSIsCorrectData(HttpServletRequest request, HttpServletResponse response) throws BaseException {
        Long startTm = System.currentTimeMillis();
        BaseLogUtils.info(logger, "getSYSIsCorrectData", " 获取鹏元三要素手机核查数据.请求参数：" + this.getRequestParameter(request), CurrentThreadContext.getCurrentUserName());
		String name = request.getParameter("name");//姓名
		String certNo = request.getParameter("certNo");//证件号
		String phone = request.getParameter("phone");//手机号
		DataResultVO result = new DataResultVO(BaseConstant.IS_YESNO_YES, SysLogConstant.LOG_CMM_OPERATE_SUCC);
		if (StringUtils.isEmpty(name) || StringUtils.isEmpty(certNo) || StringUtils.isEmpty(phone)) {
			result.setSuccess(BaseConstant.IS_YESNO_NO);
			result.setInfo("姓名、证件号、手机号不能为空");
			BaseLogUtils.info(logger, "getSYSIsCorrectData", this.getRequestParameter(request));
			return result;
		}
		try {
			RskCtrlIsCorrectQC qc = new RskCtrlIsCorrectQC();
			qc.setName(name);
			qc.setCertNo(certNo);
			qc.setPhone(phone);
			DataResultDTO data = this.rskCtrlRecService.checkSYSIsCorrect(qc);
			result.setData(data.getData());
		} catch (BaseException ex) {
			ex.getStackTrace();
			result.setSuccess(BaseConstant.IS_YESNO_NO);
			result.setInfo(ex.getMessage());
			BaseLogUtils.info(logger, "getSYSIsCorrectData", "获取数据失败!" + this.getRequestParameter(request) + ", ERROR : " + ex.getMessage(), CurrentThreadContext.getCurrentUserName());
		} catch (Exception ex) {
			ex.getStackTrace();
			result.setSuccess(BaseConstant.IS_YESNO_NO);
			result.setInfo(SysLogConstant.LOG_CMM_SYS_ERROR);
			BaseLogUtils.error(logger, "getSYSIsCorrectData", "获取数据失败!" + this.getRequestParameter(request) + ", ERROR : " + ex.getMessage(), CurrentThreadContext.getCurrentUserName());
		}
        Long endTm = System.currentTimeMillis();
        BaseLogUtils.info(logger, "getSYSIsCorrectData", " 获取鹏元三要素手机核查数据.耗时：" + (endTm-startTm), CurrentThreadContext.getCurrentUserName());
		return result;
	}

	/**
	 * 获取鹏元学历核查结果
	 */
	@RequestMapping(value = "/getPyEduIsCorrectData.do", method = { RequestMethod.GET })
	@ResponseBody
	public Object getPyEduIsCorrectData(HttpServletRequest request, HttpServletResponse response) throws BaseException {
        Long startTm = System.currentTimeMillis();
        BaseLogUtils.info(logger, "getPyEduIsCorrectData", " 获取鹏元学历核查结果.请求参数：" + this.getRequestParameter(request), CurrentThreadContext.getCurrentUserName());
		String name = request.getParameter("name");//姓名
		String certNo = request.getParameter("certNo");//证件号
		String phone = request.getParameter("phone");//手机号
		DataResultVO result = new DataResultVO(BaseConstant.IS_YESNO_YES, SysLogConstant.LOG_CMM_OPERATE_SUCC);
		if (StringUtils.isEmpty(name) || StringUtils.isEmpty(certNo) || StringUtils.isEmpty(phone)) {
			result.setSuccess(BaseConstant.IS_YESNO_NO);
			result.setInfo("姓名、证件号、手机号不能为空");
			BaseLogUtils.info(logger, "getPyEduIsCorrectData", this.getRequestParameter(request));
			return result;
		}
		try {
			RskCtrlIsCorrectQC qc = new RskCtrlIsCorrectQC();
			qc.setName(name);
			qc.setCertNo(certNo);
			qc.setPhone(phone);
			DataResultDTO data = this.rskCtrlRecService.checkPyEduIsCorrect(qc);
			result.setData(data.getData());
		} catch (BaseException ex) {
			result.setSuccess(BaseConstant.IS_YESNO_NO);
			result.setInfo(ex.getMessage());
			BaseLogUtils.info(logger, "getPyEduIsCorrectData", "获取数据失败!" + this.getRequestParameter(request) + ", ERROR : " + ex.getMessage(), CurrentThreadContext.getCurrentUserName());
		} catch (Exception ex) {
			result.setSuccess(BaseConstant.IS_YESNO_NO);
			result.setInfo(SysLogConstant.LOG_CMM_SYS_ERROR);
			BaseLogUtils.error(logger, "getPyEduIsCorrectData", "获取数据失败!" + this.getRequestParameter(request) + ", ERROR : " + ex.getCause().getMessage(), CurrentThreadContext.getCurrentUserName());
		}
        Long endTm = System.currentTimeMillis();
        BaseLogUtils.info(logger, "getPyEduIsCorrectData", " 获取鹏元学历核查结果.耗时：" + (endTm-startTm), CurrentThreadContext.getCurrentUserName());
		return result;
	}
	
	
	/**
	 * 获取聚信立数据
	 */
	@RequestMapping(value = "/getJXLIsCorrectData.do", method = { RequestMethod.GET })
	@ResponseBody
	public Object getJXLIsCorrectData(HttpServletRequest request, HttpServletResponse response) throws BaseException {
        Long startTm = System.currentTimeMillis();
        BaseLogUtils.info(logger, "getJXLIsCorrectData", " 获取聚信立数据.请求参数：" + this.getRequestParameter(request), CurrentThreadContext.getCurrentUserName());
		String name = request.getParameter("name");//姓名
		String certNo = request.getParameter("certNo");//证件号
		String phone = request.getParameter("phone");//手机号
		DataResultVO result = new DataResultVO(BaseConstant.IS_YESNO_YES, SysLogConstant.LOG_CMM_OPERATE_SUCC);
		if (StringUtils.isEmpty(name) || StringUtils.isEmpty(certNo) || StringUtils.isEmpty(phone)) {
			result.setSuccess(BaseConstant.IS_YESNO_NO);
			result.setInfo("姓名、证件号、手机号不能为空");
			BaseLogUtils.info(logger, "getJXLIsCorrectData", this.getRequestParameter(request));
			return result;
		}
		try {
			RskCtrlIsCorrectQC qc = new RskCtrlIsCorrectQC();
			qc.setName(name);
			qc.setCertNo(certNo);
			qc.setPhone(phone);
			DataResultDTO data = this.rskCtrlRecService.checkJXLIsCorrect(qc);
			result.setData(data.getData());
		} catch (BaseException ex) {
			ex.getStackTrace();
			result.setSuccess(BaseConstant.IS_YESNO_NO);
			result.setInfo(ex.getMessage());
			BaseLogUtils.info(logger, "getJXLIsCorrectData", "获取数据失败!" + this.getRequestParameter(request) + ", ERROR : " + ex.getMessage(), CurrentThreadContext.getCurrentUserName());
		} catch (Exception ex) {
			ex.getStackTrace();
			result.setSuccess(BaseConstant.IS_YESNO_NO);
			result.setInfo(SysLogConstant.LOG_CMM_SYS_ERROR);
			BaseLogUtils.error(logger, "getJXLIsCorrectData", "获取数据失败!" + this.getRequestParameter(request) + ", ERROR : " + ex.getMessage(), CurrentThreadContext.getCurrentUserName());
		}
        Long endTm = System.currentTimeMillis();
        BaseLogUtils.info(logger, "getJXLIsCorrectData", " 获取聚信立数据.耗时：" + (endTm-startTm), CurrentThreadContext.getCurrentUserName());
		return result;
	}

	
	/**
	 * 获取百融数据
	 */
	@RequestMapping(value = "/getBrIsCorrectData.do", method = { RequestMethod.GET })
	@ResponseBody
	public Object getBrIsCorrectData(HttpServletRequest request, HttpServletResponse response) throws BaseException {
        Long startTm = System.currentTimeMillis();
        BaseLogUtils.info(logger, "getBrIsCorrectData", " 获取百融数据.请求参数：" + this.getRequestParameter(request), CurrentThreadContext.getCurrentUserName());
		String name = request.getParameter("name");//姓名
		String certNo = request.getParameter("certNo");//证件号
		String phone = request.getParameter("phone");//手机号
		DataResultVO result = new DataResultVO(BaseConstant.IS_YESNO_YES, SysLogConstant.LOG_CMM_OPERATE_SUCC);
		if (StringUtils.isEmpty(name) || StringUtils.isEmpty(certNo) || StringUtils.isEmpty(phone)) {
			result.setSuccess(BaseConstant.IS_YESNO_NO);
			result.setInfo("姓名、证件号、手机号不能为空");
			BaseLogUtils.info(logger, "getBrIsCorrectData", this.getRequestParameter(request));
			return result;
		}
		try {
			RskCtrlIsCorrectQC qc = new RskCtrlIsCorrectQC();
			qc.setName(name);
			qc.setCertNo(certNo);
			qc.setPhone(phone);
			DataResultDTO data = this.rskCtrlRecService.checkBrIsCorrect(qc);
			result.setData(data.getData());
		} catch (BaseException ex) {
			ex.getStackTrace();
			result.setSuccess(BaseConstant.IS_YESNO_NO);
			result.setInfo(ex.getMessage());
			BaseLogUtils.info(logger, "getBrIsCorrectData", "获取数据失败!" + this.getRequestParameter(request) + ", ERROR : " + ex.getMessage(), CurrentThreadContext.getCurrentUserName());
		} catch (Exception ex) {
			ex.getStackTrace();
			result.setSuccess(BaseConstant.IS_YESNO_NO);
			result.setInfo(SysLogConstant.LOG_CMM_SYS_ERROR);
			BaseLogUtils.error(logger, "getBrIsCorrectData", "获取数据失败!" + this.getRequestParameter(request) + ", ERROR : " + ex.getMessage(), CurrentThreadContext.getCurrentUserName());
		}
        Long endTm = System.currentTimeMillis();
        BaseLogUtils.info(logger, "getBrIsCorrectData", " 获取百融数据.耗时：" + (endTm-startTm), CurrentThreadContext.getCurrentUserName());
		return result;
	}

	/**
	 * 获取百融不良信息数据
	 */
	@RequestMapping(value = "/getBrblIsCorrectData.do", method = { RequestMethod.GET })
	@ResponseBody
	public Object getBrblIsCorrectData(HttpServletRequest request, HttpServletResponse response) throws BaseException {
        Long startTm = System.currentTimeMillis();
        BaseLogUtils.info(logger, "getBrblIsCorrectData", " 获取百融不良信息数据.请求参数：" + this.getRequestParameter(request), CurrentThreadContext.getCurrentUserName());
		String name = request.getParameter("name");//姓名
		String certNo = request.getParameter("certNo");//证件号
		String phone = request.getParameter("phone");//手机号
		DataResultVO result = new DataResultVO(BaseConstant.IS_YESNO_YES, SysLogConstant.LOG_CMM_OPERATE_SUCC);
		if (StringUtils.isEmpty(name) || StringUtils.isEmpty(certNo) || StringUtils.isEmpty(phone)) {
			result.setSuccess(BaseConstant.IS_YESNO_NO);
			result.setInfo("姓名、证件号、手机号不能为空");
			BaseLogUtils.info(logger, "getBrblIsCorrectData", this.getRequestParameter(request));
			return result;
		}
		try {
			RskCtrlIsCorrectQC qc = new RskCtrlIsCorrectQC();
			qc.setName(name);
			qc.setCertNo(certNo);
			qc.setPhone(phone);
			DataResultDTO data = this.rskCtrlRecService.checkBrblIsCorrect(qc);
			result.setData(data.getData());
		} catch (BaseException ex) {
			ex.getStackTrace();
			result.setSuccess(BaseConstant.IS_YESNO_NO);
			result.setInfo(ex.getMessage());
			BaseLogUtils.info(logger, "getBrblIsCorrectData", "获取数据失败!" + this.getRequestParameter(request) + ", ERROR : " + ex.getMessage(), CurrentThreadContext.getCurrentUserName());
		} catch (Exception ex) {
			ex.getStackTrace();
			result.setSuccess(BaseConstant.IS_YESNO_NO);
			result.setInfo(SysLogConstant.LOG_CMM_SYS_ERROR);
			BaseLogUtils.error(logger, "getBrblIsCorrectData", "获取数据失败!" + this.getRequestParameter(request) + ", ERROR : " + ex.getMessage(), CurrentThreadContext.getCurrentUserName());
		}
        Long endTm = System.currentTimeMillis();
        BaseLogUtils.info(logger, "getBrblIsCorrectData", " 获取百融不良信息数据.耗时：" + (endTm-startTm), CurrentThreadContext.getCurrentUserName());
		return result;
	}

	/**
	 * 获取百融个人信息关联数据
	 */
	@RequestMapping(value = "/getBrPersonIsCorrectData.do", method = { RequestMethod.GET })
	@ResponseBody
	public Object getBrPersonIsCorrectData(HttpServletRequest request, HttpServletResponse response) throws BaseException {
        Long startTm = System.currentTimeMillis();
        BaseLogUtils.info(logger, "getBrPersonIsCorrectData", " 获取百融个人信息关联数据.请求参数：" + this.getRequestParameter(request), CurrentThreadContext.getCurrentUserName());
		String name = request.getParameter("name");//姓名
		String certNo = request.getParameter("certNo");//证件号
		String phone = request.getParameter("phone");//手机号
		DataResultVO result = new DataResultVO(BaseConstant.IS_YESNO_YES, SysLogConstant.LOG_CMM_OPERATE_SUCC);
		if (StringUtils.isEmpty(name) || StringUtils.isEmpty(certNo) || StringUtils.isEmpty(phone)) {
			result.setSuccess(BaseConstant.IS_YESNO_NO);
			result.setInfo("姓名、证件号、手机号不能为空");
			BaseLogUtils.info(logger, "getBrPersonIsCorrectData", this.getRequestParameter(request));
			return result;
		}
		try {
			RskCtrlIsCorrectQC qc = new RskCtrlIsCorrectQC();
			qc.setName(name);
			qc.setCertNo(certNo);
			qc.setPhone(phone);
			DataResultDTO data = this.rskCtrlRecService.checkBrPersonIsCorrect(qc);
			result.setData(data.getData());
		} catch (BaseException ex) {
			result.setSuccess(BaseConstant.IS_YESNO_NO);
			result.setInfo(ex.getMessage());
			BaseLogUtils.info(logger, "getBrPersonIsCorrectData", "获取数据失败!" + this.getRequestParameter(request) + ", ERROR : " + ex.getMessage(), CurrentThreadContext.getCurrentUserName());
		} catch (Exception ex) {
			result.setSuccess(BaseConstant.IS_YESNO_NO);
			result.setInfo(SysLogConstant.LOG_CMM_SYS_ERROR);
			BaseLogUtils.error(logger, "getBrPersonIsCorrectData", "获取数据失败!" + this.getRequestParameter(request) + ", ERROR : " + ex.getCause().getMessage(), CurrentThreadContext.getCurrentUserName());
		}
        Long endTm = System.currentTimeMillis();
        BaseLogUtils.info(logger, "getBrPersonIsCorrectData", " 获取百融个人信息关联数据.耗时：" + (endTm-startTm), CurrentThreadContext.getCurrentUserName());
		return result;
	}

	
	/**
	 * 获取同盾数据
	 */
	@RequestMapping(value = "/getTDIsCorrectData.do", method = { RequestMethod.GET })
	@ResponseBody
	public Object getTDIsCorrectData(HttpServletRequest request, HttpServletResponse response) throws BaseException {
        Long startTm = System.currentTimeMillis();
        BaseLogUtils.info(logger, "getTDIsCorrectData", " 获取同盾数据.请求参数：" + this.getRequestParameter(request), CurrentThreadContext.getCurrentUserName());
		String name = request.getParameter("name");//姓名
		String certNo = request.getParameter("certNo");//证件号
		String phone = request.getParameter("phone");//手机号
		DataResultVO result = new DataResultVO(BaseConstant.IS_YESNO_YES, SysLogConstant.LOG_CMM_OPERATE_SUCC);
		if (StringUtils.isEmpty(name) || StringUtils.isEmpty(certNo) || StringUtils.isEmpty(phone)) {
			result.setSuccess(BaseConstant.IS_YESNO_NO);
			result.setInfo("姓名、证件号、手机号不能为空");
			BaseLogUtils.info(logger, "getTDIsCorrectData", this.getRequestParameter(request));
			return result;
		}
		try {
			RskCtrlIsCorrectQC qc = new RskCtrlIsCorrectQC();
			qc.setName(name);
			qc.setCertNo(certNo);
			qc.setPhone(phone);
			DataResultDTO data = this.rskCtrlRecService.checkTDIsCorrect(qc);
			result.setData(data.getData());
		} catch (BaseException ex) {
			ex.getStackTrace();
			result.setSuccess(BaseConstant.IS_YESNO_NO);
			result.setInfo(ex.getMessage());
			BaseLogUtils.info(logger, "getTDIsCorrectData", "获取数据失败!" + this.getRequestParameter(request) + ", ERROR : " + ex.getMessage(), CurrentThreadContext.getCurrentUserName());
		} catch (Exception ex) {
			ex.getStackTrace();
			result.setSuccess(BaseConstant.IS_YESNO_NO);
			result.setInfo(SysLogConstant.LOG_CMM_SYS_ERROR);
			BaseLogUtils.error(logger, "getTDIsCorrectData", "获取数据失败!" + this.getRequestParameter(request) + ", ERROR : " + ex.getMessage(), CurrentThreadContext.getCurrentUserName());
		}
        Long endTm = System.currentTimeMillis();
        BaseLogUtils.info(logger, "getTDIsCorrectData", " 获取同盾数据.耗时：" + (endTm-startTm), CurrentThreadContext.getCurrentUserName());
		return result;
	}
	
	
	/**
	 * 获取中智诚数据
	 */
	@RequestMapping(value = "/getZZCIsCorrectData.do", method = { RequestMethod.GET })
	@ResponseBody
	public Object getZZCIsCorrectData(HttpServletRequest request, HttpServletResponse response) throws BaseException {
        Long startTm = System.currentTimeMillis();
        BaseLogUtils.info(logger, "getZZCIsCorrectData", " 获取中智诚数据.请求参数：" + this.getRequestParameter(request), CurrentThreadContext.getCurrentUserName());
		String name = request.getParameter("name");//姓名
		String certNo = request.getParameter("certNo");//证件号
		String phone = request.getParameter("phone");//手机号
		DataResultVO result = new DataResultVO(BaseConstant.IS_YESNO_YES, SysLogConstant.LOG_CMM_OPERATE_SUCC);
		if (StringUtils.isEmpty(name) || StringUtils.isEmpty(certNo) || StringUtils.isEmpty(phone)) {
			result.setSuccess(BaseConstant.IS_YESNO_NO);
			result.setInfo("姓名、证件号、手机号不能为空");
			BaseLogUtils.info(logger, "getZZCIsCorrectData", this.getRequestParameter(request));
			return result;
		}
		try {
			RskCtrlIsCorrectQC qc = new RskCtrlIsCorrectQC();
			qc.setName(name);
			qc.setCertNo(certNo);
			qc.setPhone(phone);
			DataResultDTO data = this.rskCtrlRecService.checkZZCIsCorrect(qc);
			result.setData(data.getData());
		} catch (BaseException ex) {
			ex.getStackTrace();
			result.setSuccess(BaseConstant.IS_YESNO_NO);
			result.setInfo(ex.getMessage());
			BaseLogUtils.info(logger, "getZZCIsCorrectData", "获取数据失败!" + this.getRequestParameter(request) + ", ERROR : " + ex.getMessage(), CurrentThreadContext.getCurrentUserName());
		} catch (Exception ex) {
			ex.getStackTrace();
			result.setSuccess(BaseConstant.IS_YESNO_NO);
			result.setInfo(SysLogConstant.LOG_CMM_SYS_ERROR);
			BaseLogUtils.error(logger, "getZZCIsCorrectData", "获取数据失败!" + this.getRequestParameter(request) + ", ERROR : " + ex.getMessage(), CurrentThreadContext.getCurrentUserName());
		}
        Long endTm = System.currentTimeMillis();
        BaseLogUtils.info(logger, "getZZCIsCorrectData", " 获取中智诚数据.耗时：" + (endTm-startTm), CurrentThreadContext.getCurrentUserName());
		return result;
	}
	
	/**
	 * 获取信加数据
	 */
	@RequestMapping(value = "/getXjIsCorrectData.do", method = { RequestMethod.GET })
	@ResponseBody
	public Object getXjIsCorrectData(HttpServletRequest request, HttpServletResponse response) throws BaseException {
        Long startTm = System.currentTimeMillis();
        BaseLogUtils.info(logger, "getXjIsCorrectData", " 获取信加数据.请求参数：" + this.getRequestParameter(request), CurrentThreadContext.getCurrentUserName());
		String name = request.getParameter("name");//姓名
		String certNo = request.getParameter("certNo");//证件号
		String phone = request.getParameter("phone");//手机号
		DataResultVO result = new DataResultVO(BaseConstant.IS_YESNO_YES, SysLogConstant.LOG_CMM_OPERATE_SUCC);
		if (StringUtils.isEmpty(name) || StringUtils.isEmpty(certNo) || StringUtils.isEmpty(phone)) {
			result.setSuccess(BaseConstant.IS_YESNO_NO);
			result.setInfo("姓名、证件号、手机号不能为空");
			BaseLogUtils.info(logger, "getXjIsCorrectData", this.getRequestParameter(request));
			return result;
		}
		try {
			RskCtrlIsCorrectQC qc = new RskCtrlIsCorrectQC();
			qc.setName(name);
			qc.setCertNo(certNo);
			qc.setPhone(phone);
//			qc.setCstId(171109296002226l);
			DataResultDTO data = this.rskCtrlRecService.checkXjIsCorrect(qc);
			result.setData(data.getData());
		} catch (BaseException ex) {
			ex.getStackTrace();
			result.setSuccess(BaseConstant.IS_YESNO_NO);
			result.setInfo(ex.getMessage());
			BaseLogUtils.info(logger, "getXjIsCorrectData", "获取数据失败!" + this.getRequestParameter(request) + ", ERROR : " + ex.getMessage(), CurrentThreadContext.getCurrentUserName());
		} catch (Exception ex) {
			ex.getStackTrace();
			result.setSuccess(BaseConstant.IS_YESNO_NO);
			result.setInfo(SysLogConstant.LOG_CMM_SYS_ERROR);
			BaseLogUtils.error(logger, "getXjIsCorrectData", "获取数据失败!" + this.getRequestParameter(request) + ", ERROR : " + ex.getMessage(), CurrentThreadContext.getCurrentUserName());
		}
        Long endTm = System.currentTimeMillis();
        BaseLogUtils.info(logger, "getXjIsCorrectData", " 获取信加数据.耗时：" + (endTm-startTm), CurrentThreadContext.getCurrentUserName());
		return result;
	}
}
